package com.trsj.lnsj.service.imp;

import com.trsj.lnsj.entity.CommentDTO;
import com.trsj.lnsj.entity.CommentRepo;
import com.trsj.lnsj.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @Package:com.trsj.lnsj.service.imp
 * @Auther: Longky
 * @Date: 2018/12/31
 * @Description:
 */
@Service
public class CommentService implements ICommentService {
    @Autowired
    private CommentRepo commentRepo;
    @Override
    public void add(CommentDTO comment){
        commentRepo.save(comment);
    }
    @Override
    public Page findByActivityId(Long  activityId, Pageable pageable){
        return commentRepo.findByActivityId(activityId,pageable);
    }
}
